home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / DINKDEMO / DINKCLAS / DSCROLLW.H < prev    next >
Text File  |  1992-07-23  |  2KB  |  90 lines

  1. /*
  2.     File:        DScrollWindow.h
  3.  
  4.     Written by:    Mark Gross
  5.  
  6.     Copyright:    ⌐ 1992 by Applied Technical Software, all rights reserved.
  7.     Use at your own risk.
  8.  
  9. */
  10.  
  11. // This is the implementation of TScrollDoc subclass in my 
  12. // class library.  
  13.  
  14. #ifndef __DSCROLLWINDOW__
  15. #define __DSCROLLWINDOW__
  16.  
  17. #include "DWindow.h"
  18.  
  19.  
  20. class DScrollWindow : public DWindow
  21. {
  22. protected:
  23.  
  24.     short            fVMin;
  25.     short            fVMax;
  26.     
  27.     short            fHMin;
  28.     short            fHMax;
  29.     
  30.     ControlHandle    fHorizScrollBar;
  31.     ControlHandle    fVertScrollBar;
  32.  
  33. public:
  34.     DScrollWindow(void);
  35.     ~DScrollWindow(void);
  36.         
  37.     virtual Boolean    Init(DDocument *doc, Boolean hasColorWindows);
  38.  
  39.     virtual void     KillMeNext(void);
  40.     virtual    void    HandleUpdateEvt(EventRecord *theEvent);
  41.     virtual void     HandleActivateEvt(EventRecord *theEvent);
  42.     virtual void     HandleOSEvent(EventRecord *theEvent);
  43.         // needed to hide the scroll bars when a context switch happens 
  44.         
  45.     virtual    short    GetVertLineScrollAmount(void);
  46.     virtual    short    GetHorizLineScrollAmount(void);
  47.     
  48.     virtual    short    GetVertPageScrollAmount(void);
  49.     virtual    short    GetHorizPageScrollAmount(void);
  50.     
  51. protected:
  52.  
  53.     virtual    void    DoGrow(EventRecord *theEvent);
  54.     virtual    void    DoZoom(short partCode);
  55.     virtual    void    DoContent(EventRecord *theEvent);
  56.  
  57.     
  58.     void    SizeScrollBars(void);
  59.  
  60. public:
  61.  
  62.     void    ValidateScrollRange(void);
  63.             
  64.     void    ValidateVertScrollRange(void);
  65.  
  66.     void    SynchScrollBars(void);
  67.     
  68. protected:
  69.  
  70.     void    ScrollClick(EventRecord *theEvent);
  71.     void    DoThumbScroll(ControlHandle theControl, Point localPt);
  72.     void    DoPageScroll(ControlHandle theControl, short part);
  73.     void    DoButtonScroll(ControlHandle theControl, Point localPt);
  74.     
  75.     virtual void    ScrollContents(short dh, short dv);
  76.  
  77.  
  78. public:
  79.     
  80.     void    DoHScroll(short change);
  81.     void    DoVScroll(short change);
  82.     
  83.     static pascal void ActionProc(ControlHandle theControl, short partCont);
  84.     
  85. };// end of class declaration for TDocRootd
  86.  
  87.     
  88.  
  89.  
  90. #endif __DSCROLLWINDOW__